OUTPUT_DEFAULT=3.hdmi_en
DIR_DEFAULT=~/share_nfs/

OUTPUT=""
DIR=""

if [ -z "$1" ];then
    OUTPUT=${OUTPUT_DEFAULT}
else
    OUTPUT=$1
fi

if [ ! -d "$2" ];then
    DIR=${DIR_DEFAULT}
else
    DIR=$2
fi

make clean;
make clean PROGRAM=${OUTPUT};
make PROGRAM=${OUTPUT} -j16 || exit 1
cp -v ${OUTPUT} ${DIR}
cp -v ${OUTPUT} ${OUTPUT}.elf
cp -v ${OUTPUT}.elf ${DIR}
cp -v ${OUTPUT}.elf ${DIR}/${OUTPUT}
